<script lang="ts">
export default {
  name: 'HomeCategory'
}
</script>
<script lang="ts" setup>
import { useStore } from '@/store/index'
const { category } = useStore()
</script>
<template>
  <div class="home-category">
    <ul class="menu">
      <li v-for="i in category.categoryList" :key="i.id">
        <RouterLink to="/">{{ i.name }}</RouterLink>
        <RouterLink
          :key="item.id"
          v-show="index < 2"
          to="/"
          v-for="(item, index) in i.children?.slice(0, 2)"
          >{{ item.name }}</RouterLink
        >
        <!-- <RouterLink to="/">{{ i.name }}</RouterLink> -->
      </li>
    </ul>
  </div>
</template>

<style scoped lang="less">
.home-category {
  width: 250px;
  height: 500px;
  background: rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 99;
  .menu {
    li {
      padding-left: 40px;
      height: 55px;
      line-height: 55px;
      &:hover {
        background: @xtxColor;
      }
      a {
        margin-right: 4px;
        color: #fff;
        &:first-child {
          font-size: 16px;
        }
      }
    }
  }
}
</style>
